package main

import (
	"fmt"
	"github.com/spf13/cast"
)

func main() {
	age2 := "23"
	age2Int8 := cast.ToInt8(age2)
	fmt.Printf("%T age2=%s\n", age2, age2)
	fmt.Printf("%T age2Int8=%d\n", age2Int8, age2Int8)

	phoneNumber2 := "138001380001380013800013800138000"
	phoneNumber2Int, _ := cast.ToIntE(phoneNumber2)
	fmt.Printf("%T phoneNumber2=%s\n", phoneNumber2, phoneNumber2)
	fmt.Printf("%T phoneNumber2Int=%d\n", phoneNumber2Int, phoneNumber2Int)

	str := "19"
	toInt := cast.ToInt8(str)
	fmt.Printf("%T age2=%s\n", str, str)
	fmt.Printf("%T age2=%d\n", toInt, toInt)
}
